package com.lagou.boot;

import com.lagou.client.RPCConsumer;
import com.lagou.entity.RpcRequest;
import com.lagou.service.IUserService;

public class ConsumerBoot {

    //参数定义
    private static final String PROVIDER_NAME = "UserService#sayHello#";

    public static void main(String[] args) throws InterruptedException {


        RpcRequest rpcRequest = new RpcRequest();
        rpcRequest.setClassName("com.coding365.rpcprovider.service.UserServiceImpl");
        rpcRequest.setMethodName("sayHello");
        String msg = "are you ok?";
        rpcRequest.setParameters(new Object[]{msg});
        rpcRequest.setParameterTypes(new Class<?>[]{String.class});



        //2.循环给服务器写数据
        while (true){
            try {
                System.out.println(RPCConsumer.call(rpcRequest));
                Thread.sleep(2000);
            }catch (Exception e){

            }
        }

    }
}
